#include <stdlib.h>  
#include <stdio.h>

struct data /*定义结构体*/

{

    int day,month,year;

};

typedef struct  /*定义结构体*/

{    

    char name[20];

    long num;

    struct data birthday; 

 /*嵌套的结构体类型成员*/

}stu;


int main(){
	
	
	stu student1;
	stu *stu1 = &student1;    //定义结构体指针变量student1 
	printf("Input name:");
	scanf("%s",&stu1->name);
	printf("Input number:");
	scanf("%d",&stu1->num);
	printf("Input year-month-day:");
	scanf("%d-%d-%d",&stu1->birthday.year,&stu1->birthday.month,&stu1->birthday.day);
	printf("\nOutput name,number,year,month,day:%s,%d,%d/%d/%d",stu1->name,stu1->num,stu1->birthday.year,stu1->birthday.month,stu1->birthday.day);
	
	printf("\n\n------另一名学生：\n"); 
	stu stu2;    //定义结构体变量student2 
    printf("Input name:");
	scanf("%s",&stu2.name);
	printf("Input number:");
	scanf("%d",&stu2.num);
	printf("Input year-month-day:");
	scanf("%d-%d-%d",&stu2.birthday.year,&stu2.birthday.month,&stu2.birthday.day);
	printf("\nOutput name,number,year,month,day:%s,%d,%d/%d/%d",stu2.name,stu2.num,stu2.birthday.year,stu2.birthday.month,stu2.birthday.day);
	
	
} 